//写一个泛型，有一个方法，求数组的最大值
class Alg<T extends Comparable<T>>{
     public T findMax(T[] array) {
         T max = array[0];
         for (int i = 1; i < array.length; i++) {
             if (max.compareTo(array[i])<0) {
                 max = array[i];
             }
         }
         return max;
     }
}
public class Text2 {
    public static void main(String[] args) {
        Alg<Integer> alg = new Alg<>();
         Integer[] array={1,2,3,4,5,6};
         Integer ret = alg.findMax(array);
        System.out.println(ret);

    }
}
